[PATCH 22/34] net: mana: Fix perf regression: remove rx_cqes, tx_cqes counters
authorHaiyang Zhang <haiyangz@microsoft.com>
Fri, 26 May 2023 15:38:57 +0000 (08:38 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 6 Mar 2025 06:21:29 +0000 (07:21 +0100)
commitf138dbdc1f776bdc9e92a7b84933d41ea1aab4cd
treeb4eea55962d0898de068f16e5aefd7d39d6fbea7
parent95b192d8d49dab3274802b29602bea0fbfc7210d
[PATCH 22/34] net: mana: Fix perf regression: remove rx_cqes, tx_cqes counters

The apc->eth_stats.rx_cqes is one per NIC (vport), and it's on the
frequent and parallel code path of all queues. So, r/w into this
single shared variable by many threads on different CPUs creates a
lot caching and memory overhead, hence perf regression. And, it's
not accurate due to the high volume concurrent r/w.

For example, a workload is iperf with 128 threads, and with RPS
enabled. We saw perf regression of 25% with the previous patch
adding the counters. And this patch eliminates the regression.

Since the error path of mana_poll_rx_cq() already has warnings, so
keeping the counter and convert it to a per-queue variable is not
necessary. So, just remove this counter from this high frequency
code path.

Also, remove the tx_cqes counter for the same reason. We have
warnings & other counters for errors on that path, and don't need
to count every normal cqe processing.

Cc: stable@vger.kernel.org
Fixes: bd7fc6e1957c ("net: mana: Add new MANA VF performance counters for easier troubleshooting")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/1685115537-31675-1-git-send-email-haiyangz@microsoft.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 1919b39fc6eabb9a6f9a51706ff6d03865f5df29)
Signed-off-by: Bastian Blank <waldi@debian.org>
Gbp-Pq: Topic features/all/ethernet-microsoft
Gbp-Pq: Name 0022-net-mana-Fix-perf-regression-remove-rx_cqes-tx_cqes-.patch
drivers/net/ethernet/microsoft/mana/mana_en.c
drivers/net/ethernet/microsoft/mana/mana_ethtool.c
include/net/mana/mana.h